package br.com.montezuma.despesas.utils;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * <pre>
 * @author : David Montezuma          
 * Purpose      :  Provider methods utility for all interfaces.
 * Amendment History                                                                
 * Date - Name - Description                              
 * 20/05/2012 - David Montezuma - initial version.
 * 
 * Copyright 2012 Montezuma Software
 * </pre>
 */
public class Util {

	public static <T> List<T> iteratorToList(Iterator<T> iterator){
		List<T> list = new ArrayList<T>();
		if(iterator!=null){
			while(iterator.hasNext()){
				T t = iterator.next();
				list.add(t);
			}
		}
		return list;
	}
	
	public static boolean isEmpty(String s){
		return s==null || s.trim().equals("");
	}
}
